# 导包
import requests

# 发送接口请求
# 定义两个字典变量，用来接收请求头和json请求体数据
header_dict = {"Content-Type": "application/json"}
json_dict = {"username": "admin", "password": "HM_2023_test", "code": "2", "uuid": "b70231efdbcc45fb8b82c60987bcd0b2"}
url_str = "http://kdtx-test.itheima.net/api/login"
resp = requests.post(url=url_str, headers=header_dict, json=json_dict)
# 查看响应数据
print(resp.status_code)
print(resp.json())
